package ysq.xyg.recovery.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 回收金模块-回收记录表实体类
 *
 * @author congcong tao
 * @date 2019-5-8 15:12:49
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_recovery_record")
public class RecoveryRecord implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
	 * memberId
	 */
	@Column(name = "member_id")
	private String memberId;

	/**
     * 名称
     */ 
	@Column(name = "name")
	private String name;

	/**
     * 类型1回收2消费3=加积分4=减积分
     */ 
	@Column(name = "type")
	private String type;

	/**
     * 金额
     */ 
	@Column(name = "money")
	private String money;

	/**
	 * 重量
	 */
	@Column(name = "weight")
	private Double weight;

	/**
     * 介绍
     */ 
	@Column(name = "description")
	private String description;

	/**
     * 有效状态1、有效2、无效
     */ 
	@Column(name = "status")
	private String status;

	/**
     * 创建者
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 更新者
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 删除状态1、未删除2、已删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 更新时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;

	@Transient
	private String createTimeStr;

	@Transient
	private String memberNickName;

	@Transient
	private String cmemberNickName;

	@Transient
	private String memberName;

	@Transient
	private String memberPhone;

	@Transient
	private String startDate;

	@Transient
	private String endDate;

	@Transient
	private String shopName;
	@Transient
	private String memberCardNo;

	public RecoveryRecord(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}